#include <bits/stdc++.h>
using namespace std;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c* x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  template <class c>
  debug& operator<<(const c&) {
    return *this;
  }
};
using ll = long long;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, q;
  cin >> n >> q;
  vector<int> a(n);
  const int m = 19;
  vector<vector<int>> pos(m);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    for (int j = 0; j < m; j++) {
      if (a[i] & 1 << j) {
        pos[j].push_back(i);
      }
    }
  }
  vector<vector<int>> dp(n, vector<int>(m, n));
  for (int i = n - 1; i >= 0; i--) {
    for (int j = 0; j < m; j++) {
      if (a[i] & 1 << j) {
        dp[i][j] = i;
        int idx = (int)(upper_bound(pos[j].begin(), pos[j].end(), i) -
                        pos[j].begin());
        if (idx < (int)pos[j].size()) {
          int v = pos[j][idx];
          assert(v > i);
          for (int k = 0; k < m; k++) {
            dp[i][k] = min(dp[i][k], dp[v][k]);
          }
        }
      }
    }
  }
  while (q--) {
    int x, y;
    cin >> x >> y;
    --x, --y;
    bool good = false;
    for (int i = 0; i < m; i++) {
      if (a[y] & 1 << i) {
        if (dp[x][i] <= y) {
          good = true;
          break;
        }
      }
    }
    cout << (good ? "Shi" : "Fou") << '\n';
  }
}
