#include <bits/stdc++.h>
using namespace std;
const long long BITS = 20;
string ans[2] = {"Fou", "Shi"};
long long nextForBit[BITS];
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, q;
  cin >> n >> q;
  long long a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  long long next[n + 1][BITS];
  fill_n(nextForBit, BITS, n);
  for (long long i = 0; i <= n; i++)
    for (long long j = 0; j < BITS; j++) next[i][j] = n;
  for (long long i = n - 1; i >= 0; i--) {
    for (long long j = 0; j < BITS; j++) {
      if (a[i] & (1 << j))
        next[i][j] = i;
      else {
        for (long long k = 0; k < BITS; k++) {
          if (a[i] & (1 << k))
            next[i][j] = min(next[i][j], next[nextForBit[k]][j]);
        }
      }
    }
    for (long long j = 0; j < BITS; j++)
      nextForBit[j] = min(nextForBit[j], next[i][j]);
  }
  while (q--) {
    long long x, y;
    cin >> x >> y;
    x--;
    y--;
    bool fl = false;
    for (long long j = 0; j < BITS; j++) {
      if (a[y] & (1 << j)) fl |= (next[x][j] <= y);
    }
    cout << ans[fl] << "\n";
  }
  return 0;
}
